package com.viknix.micrometer.demo.service;

import io.micrometer.core.instrument.Metrics;
import io.micrometer.core.instrument.Timer;
import org.springframework.stereotype.Service;

import java.util.concurrent.TimeUnit;

/**
 * @Author: Dongqi
 * @Date: 2021/11/18 18:41
 * @Version 1.0
 * @Description:
 */
@Service("micrometerService")
public class MicrometerService {

    public void timer() {
        Timer timer = Metrics.timer("nacos_timer", "module", "config", "name", "notifyRt");
        timer.record(2000, TimeUnit.MILLISECONDS);
    }
}
